cmake_minimum_required(VERSION 3.10.2)
#cmake_policy(SET CMP0074 OLD)

project(SGTF_EXE VERSION 0.1.0)

set(CMAKE_WARN_DEPRECATED FALSE) # 不显示cmake deprecated警告

# c++ version
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
################################
# compiler flags

if((CMAKE_SYSTEM_NAME MATCHES "Windows") AND (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"))
    add_compile_options(/wd4819)
    add_compile_options(/wd4996)
    add_compile_options(/EHsc) # C程序(extern C)不抛出异常，C++ exception handling
    add_compile_options(/utf-8) # 强制要求UTF-8编译(fxxk MSVC)
    add_compile_options(-bigobj)
    set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -W3")
endif()
################################

#目标目录
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/${CMAKE_BUILD_TYPE})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dll/${CMAKE_BUILD_TYPE})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})

set(LIB_TYPE SHARED)

add_subdirectory(utility) # 先编译SGUtilityLib.dll
add_subdirectory(sgpcl) # 先编译SGPCLLib.dll
add_subdirectory(sgtunnelface1.0) # 掌子面相关算法模块1.0版本（home made算法）
add_subdirectory(sgtunnelface2.0) # 掌子面相关算法模块2.0版本（基于pcl）
add_subdirectory(SGTFRecognizerAPI) # 掌子面服务器端dll（可被服务器直接调用）
add_subdirectory(TunnelScan) # 隧道断面扫描点云分析程序
add_subdirectory(ZFSScanData) # 太湖隧道断面扫描点云分析程序
################################
